System and method for managing a heterogeneous cache

ABSTRACT

A data processing device includes a cache. The cache stores data. The data processing device also includes a cache manager. The cache manager monitors use of the cache to obtain cache use data. The cache manager identifies a slot allocation of the cache. The cache manager generates a new slot allocation based on the cache use data and the slot allocation. The cache manager reformats the cache based on the new slot allocation to obtain an updated cache.

BACKGROUND

Computing devices may generate data during their operation. For example,applications hosted by the computing devices may generate data used bythe applications to perform their functions. Such data may be stored inpersistent storage of the computing devices.

Depending on the number and type of applications hosted by a computingdevice, data may be generated at different rates. For example, someapplications may generate large amounts of data very quickly while othertypes of application may generate data very slowly. The resulting datageneration rate for all of the applications hosted by a computing devicemay place a storage workload on the computing device that must beserviced by the storage resources of the computing device.

SUMMARY

In one aspect, a data processing device in accordance with one or moreembodiments of the invention includes a cache for storing data and acache manager. The cache manager monitors use of the cache to obtaincache use data; identifies a slot allocation of the cache; generates anew slot allocation based on the cache use data and the slot allocation;and reformats the cache based on the new slot allocation to obtain anupdated cache.

In one aspect, a method for managing a cache in accordance with one ormore embodiments of the invention includes monitoring use of the cacheto obtain cache use data; identifying a slot allocation of the cache;generating a new slot allocation based on the cache use data and theslot allocation; and reformatting the cache based on the new slotallocation to obtain an updated cache.

A non-transitory computer readable medium in accordance with one or moreembodiments of the invention includes computer readable program code,which when executed by a computer processor enables the computerprocessor to perform a method for managing a cache. The method includesmonitoring use of the cache to obtain cache use data; identifying a slotallocation of the cache; generating a new slot allocation based on thecache use data and the slot allocation; and reformatting the cache basedon the new slot allocation to obtain an updated cache.

BRIEF DESCRIPTION OF DRAWINGS

Certain embodiments of the invention will be described with reference tothe accompanying drawings. However, the accompanying drawings illustrateonly certain aspects or implementations of the invention by way ofexample and are not meant to limit the scope of the claims.

FIG. 1 shows a diagram of a data processing device in accordance withone or more embodiments of the invention.

FIG. 2.1 shows a diagram of an example cache in accordance with one ormore embodiments of the invention.

FIG. 2.2 shows a diagram of example slots in accordance with one or moreembodiments of the invention.

FIG. 3.1 shows a flowchart of a method of storing data in a cache inaccordance with one or more embodiments of the invention.

FIG. 3.2 shows a flowchart of a method of generating cache use data inaccordance with one or more embodiments of the invention.

FIG. 3.3 shows a flowchart of a method of recycling slots in accordancewith one or more embodiments of the invention.

FIG. 3.4 shows a flowchart of a method of reformatting a cache inaccordance with one or more embodiments of the invention.

FIGS. 4.1-4.5 show a non-limiting example of a system in accordance withembodiments of the invention at different points in time.

FIG. 5 shows a diagram of a computing device in accordance with one ormore embodiments of the invention.

DETAILED DESCRIPTION

Specific embodiments will now be described with reference to theaccompanying figures. In the following description, numerous details areset forth as examples of the invention. It will be understood by thoseskilled in the art that one or more embodiments of the present inventionmay be practiced without these specific details and that numerousvariations or modifications may be possible without departing from thescope of the invention. Certain details known to those of ordinary skillin the art are omitted to avoid obscuring the description.

In the following description of the figures, any component describedwith regard to a figure, in various embodiments of the invention, may beequivalent to one or more like-named components described with regard toany other figure. For brevity, descriptions of these components will notbe repeated with regard to each figure. Thus, each and every embodimentof the components of each figure is incorporated by reference andassumed to be optionally present within every other figure having one ormore like-named components. Additionally, in accordance with variousembodiments of the invention, any description of the components of afigure is to be interpreted as an optional embodiment, which may beimplemented in addition to, in conjunction with, or in place of theembodiments described with regard to a corresponding like-namedcomponent in any other figure.

In general, embodiments of the invention relate to systems, devices, andmethods for providing data storage services. For example, a systemand/or device in accordance with embodiments of the invention mayinclude persistent storage for storing data and a cache associated withthe persistent storage. The cache may be used to provide high speed datastorage services to buffer data that is going to be stored in thepersistent storage. By doing so, data may be generated at a rate fasterthan the rate at which data may be stored in the persistent storagewithout deleterious impacts.

In one or more embodiments of the invention, the cache includes slots ofdifferent sizes, i.e., a heterogeneous cache. A slot of the cache may bethe smallest addressable portion of the cache. By having slots ofdifferent sizes, blocks of data of different sizes may be stored inslots of corresponding sizes. By storing the blocks of the data in slotsof the same size, the storage footprint for storing the blocks may beminimized while also minimizing the number of block allocations requiredto store the blocks of the data. In contrast, a mismatch between theblock size in the slot size may cause the blocks to have an increasedstorage footprint and/or require multiple block allocations for thestorage of each block of the data.

Additionally, the cache may be structured to recycle slots of each slotsize to minimize the number of slots of each size that are queued forreuse. The recycling of the slots may be modified based on informationobtained regarding the cache during prior operation of the cache. Bydoing so, the efficiency of the use of the storage resources of thecache may be improved when compared to contemporary methods that do notdynamically modify process of recycling slots.

Further, embodiments of the invention may provide for slot recyclingindependent of storage of data in the cache. By doing so, resources maybe better prioritized to the time sensitive task of storing data in thecache rather than on recycling of used slots of the cache.

FIG. 1 shows a diagram of the data processing device (100) in accordancewith one or more embodiments of the invention. The data processingdevice (100) may include computing resources (e.g., processingresources, memory resources, storage resources, communication resources,and/or other types).

The computing resources may include processors, memory (e.g., 110),persistent storage (e.g., 120), etc. that provide the data processingdevice (100) with computing resources. In one or more embodiments of theinvention, the data processing device (100) is a computing device. Foradditional information regarding computing devices, refer to FIG. 5.

In one or more embodiments of the invention, the data processing device(100) hosts one or more applications (102). The applications (102) maybe logical entities that utilize the computing resources of the dataprocessing device (100) for their execution. In other words, each of theapplications (102) may be implemented as computer instructions stored inpersistent storage (e.g., 120) that when executed by a processor of thedata processing device (100) and/or other entities give rise to thefunctionality of the applications (102). The data processing device(100) may host any number of applications (102) without departing fromthe invention.

The applications (102) may provide application services to users of thedata processing device (100), other entities hosted by the dataprocessing device (100), and/or to other entities that are remote, e.g.,operably connected to the data processing device (100) via one or morewired and/or wireless networks, from the data processing device (100).For example, the applications (102) may be database applications,electronic communication applications, filesharing applications, and/orother types of applications.

Each of the applications (102) may perform similar or differentfunctions. For example, a first application may be a databaseapplication and a second application may be an electronic communicationsapplication. In another example, a first application may be a firstinstance of a database application and a second application may be asecond instance of the database application.

In one or more embodiments of the invention, all, or portion, of theapplications (102) provide application services. The provided servicesmay correspond to the type of application of each of the applications(102). When providing application services, the applications (102) maystore application data (122) in persistent storage (120). Theapplication data (122) may be any type and quantity of data.

However, the speed at which data may be stored in persistent storage(120) may be much slower than the speed at which data may be stored inmemory (110). To improve the rate at which stored data may be stored,the data processing device (100) may include a cache (112) for (orotherwise associated with) the persistent storage (120).

The cache (112) may be a data structure for storing data until it may bestored in the persistent storage (120). For example, consider a scenarioin which the applications (102) generate application data at 1 Gigabyteper second for 10 seconds resulting in the generation of 10 Gigabytes ofdata for storage in persistent storage. However, the persistent storagemay only be capable of storing data at a rate of 0.1 Gigabytes persecond while the memory may be capable of storing data at a rate of 10Gigabytes per second. In such a scenario, it is not possible for thepersistent storage to keep up with the data generation rate of theapplications.

To address such a scenario and/or for other reasons, data generated bythe applications (102) and/or other entities may be stored in the cache(112). Once stored in the cache (112), the data in the cache may bequeued for storage in the persistent storage (120) as the applicationdata (122). In this manner, the cache (112) may be used to temporarilystore data at a high rate of speed so that the persistent storage (120)may store the data over a longer period of time to accommodate is slowerdata storing capabilities.

The cache (112) may be logically divided into slots. A slot may be thesmallest addressable portion of the cache (112). A may include apredetermined number of bits, e.g., a slot size. The cache (112) mayinclude slots of different sizes. For example, the cache (112) mayinclude a first slot having a size of 8 kilobytes, a second slot havinga size of 16 kilobytes, a third slot having a size of 32 kilobytes, etc.

When data is stored in the cache (112), different sizes of slots may bepreferentially used for the storage depending on the size of the blocksof the data. For example, when data is stored in the cache (112), it maybe performed by streaming blocks of the data of a predetermined size,e.g., 8 kilobytes, 16 kilobytes, 32 kilobytes, etc. Slots of a sizecorresponding to the block size of the data may be preferentially usedfor storing the data. By doing so, the overhead for storing the dataand/or the footprint of the data in the cache may be minimized.

For example, if a block of data does not match a slot size, multipleslots may need to be used to store the block. In such a scenario, theoverhead for storing the block is higher because multiple slotallocations may need to be performed for storing the block. Each suchallocation may have a corresponding computational cost.

In another example, if a block of data does not match a slot size, aportion of the slot may not be used if the block is smaller than theslot. This results in the block consuming more storage space of thememory (110) for storage because the unused portion of the slot is notaddressable. Consequently, the unused portion of the slot is effectivelyconsumed by storing of the block in the slot.

Thus, embodiments of the invention may provide a more efficient methodfor utilizing a cache by matching the block size of data to slots havingthe same, or similar, block sizes. By doing so, the footprint of theblocks may be reduced and the computation cost for storing may bereduced by reducing the number of slot allocation operations that needto be performed when compared to contemporary caches. For additionaldetails regarding the cache (112), refer to FIGS. 2.1-2.2.

While the cache (112) is illustrated as being hosted by memory (110),e.g., general purpose random access memory, in FIG. 1, the cache (112)may be hosted by special purpose volatile memory, separate from thememory (110), without departing from the invention. For example, thecache (112) may be hosted by a storage controller (not shown) or anotherspecial purpose device for managing data storage. A storage controllermay be a hardware device used to manage data storage. The storagecontroller may include volatile memory for storage of the cache (112).The volatile memory may be very high performance, i.e., very lowlatency, high input output operation throughput, high bandwidth, etc.The performance of the volatile memory of the storage controller mayeven surpass that of the memory (110). In such a scenario, thefunctionality of the input output managers (104) and the cache manager(106), discussed below, may be performed by the storage controller.

The storage controller may be a part of the data processing device (100)or may be part of another device. For example, the storage controllermay be a part of another data processing device. Alternatively, thestorage controller may be an independent device.

Further, in some embodiments of the invention, multiple storagecontrollers may cooperatively manage storing of data in the persistentstorage (120). In such a scenario, each of the storage controllers maybe separate hardware devices that manage storage of data in one or morehardware storage devices of the persistent storage (120). The collectiveaction of the multiple storage controllers may provide the functionalityof the input output managers (104), the cache manager (106), and thecache (114). To provide such functionality, each of the storagecontrollers may include processing resources, memory resources, storageresources, and/or communication resources.

Each of the multiple storage controllers may be part of the dataprocessing device (100), may be hosted by other device (e.g., other dataprocessing devices), and/or may be separate, independent devices.

To manage the process of storing data via the cache (112), the dataprocessing device (100) may include input output managers (104) and acache manager (106). Each of these components of the data processingdevice (100) is discussed below.

The input output managers (104) may be applications tasked withfacilitating the storage of data from the applications (102) in thepersistent storage (120). To do so, the input output managers (104) maymatch a block size of the data to corresponding slots for storing of thedata in the cache (112) temporarily. The matched slots may be used tostore the data.

If slots of the block size are unavailable for storing the data, theinput output manager (104) may use slots of other sizes for storing ofthe data. However, as noted above, doing so may be inefficient. As willbe discussed in greater detail below, the number of slots of each sizemay be dynamically adjusted to reduce the likelihood that slots of thesize corresponding to data block sizes are unavailable.

While the input output managers (104) have been described asapplications, e.g., computer instructions stored in persistent storagethat when executed by a processor of the data processing device (100)cause the data processing device (100) to perform the functionality ofthe input output managers (104), the input output managers (104) may beimplemented as a hardware device without departing from the invention.For example, the input output managers (104) may be implemented as anapplication specific circuit, a digital signal processor, or any othertype of specialized hardware device for providing the functionality ofthe input output managers (104).

To provide the above noted functionality of the input output managers(104), the input output managers (104) may perform all, or a portion, ofthe method illustrated in FIG. 3.1.

The cache manager (106) may be an application that provides cachemanagement services. Cache management services may include (i)monitoring use of the cache to obtain cache use data (114), (ii) settingrecycle rates for slots based on the obtained cache use data (114),(iii) dynamically adjusting the number of slots of different sizes ofthe cache based on the obtained cache use data (114), and (iv) recyclingslots of the cache (112) based on the cache use data (114). By doing so,the cache manager (106) may adjust the operation of the cache (112) tomatch the storage workloads, e.g., storage demands of the applications(102), of the data processing device (100). In other words, as thestorage workloads of the data processing device (100) change over time,the cache manager (106) may update the operation of the cache (112)based on the changes to the storage workloads to more efficientlyprovide cache services.

In one or more embodiments of the invention, the cache manager (106)operates independently of the input output managers (104). For example,the functionality of the cache manager (106) may be performed withoutinterfering with or otherwise impacting the functionality of the inputoutput managers (104). In other words, the functionality of managing thecache may be bifurcated from the functionality of storing data in thecache (112) facilitated by the input output managers (104). By doing so,management of the cache (112) may not impact the time sensitive duty ofstoring data that is performed by the input output managers (104). Forexample, the cache manager (106) may recycle slots of the cache (112)without burdening the input output managers (104).

While the cache manager (106) has been described as applications, e.g.,computer instructions stored in persistent storage that when executed bya processor of the data processing device (100) cause the dataprocessing device (100) to perform the functionality of the cachemanager (106), the cache manager (106) may be implemented as a hardwaredevice without departing from the invention. For example, the cachemanager (106) may be implemented as an application specific circuit, adigital signal processor, or any other type of specialized hardwaredevice for providing the functionality of the cache manager (106).

To provide the above noted functionality of the cache manager (106), thecache manager (106) may perform all, or a portion, of the methodsillustrated in FIGS. 3.2-3.4.

The persistent storage (120) may store data including the applicationdata (122) and a cache use data repository (124). The cache use datarepository (124) may include copies of the cache use data (114) overtime. For example, as the storage workloads of the data processingdevice (100) change, the information included in the cache use data(114) may change. Copies of the cache use data (114), or portionsthereof, at different points in time may be stored in the cache use datarepository (124).

The persistent storage (120) may include any number of physical storagedevices for storing data. For example, the persistent storage (120) mayinclude hard disk drives, solid state drives, tape drives, and/or anyother type of physical device for storing data.

While the data processing device (100) of FIG. 1 has been described andillustrated as including a limited number of components for the sake ofbrevity, a data processing device (100) in accordance with embodimentsof the invention may include additional, fewer, and/or differentcomponents than those illustrated in FIG. 1 without departing from theinvention.

As discussed above, the cache manager (106) may manage the cache (112).FIG. 2.1 shows a diagram of an example cache (200) in accordance withone or more embodiments of the invention.

The example cache (200) may include any number of slots (202), slotqueues (204) associated with groups of the slots (202), and slot recyclerates (206) associated with the groups of the slots (202). Each of thesedata structures is discussed below.

As discussed above, the slots (202) may be the smallest addressableportions of the example cache (200). Each of the slots (202) may beassociated with a portion of the physical data storage resources of thememory. As will be discussed in greater detail with respect to FIG. 2.2,the slots (202) may be grouped based on the size of the slots.

The slot queues (204) may be data structures that specify an order inwhich the slots are used for data storage purposes. There slot queues(204) may include a queue for each group of the slots.

For example, when a slot that was storing data is recycled, it may beadded to a slot queue associated with a slot group that includes theslots of the size of the slot. Thus, all slots of a particular size maybe ordered with respect to each other for data storage purposes.

By doing so, a queue for each slot size may be generated. Consequently,when an input output manager receives a block of a data of a particularsize, the input output manager may determine a slot for storing the databy selecting the next queued slot of slot size of the block. If no suchslots are available, one or more slots of another size may be selectedfor storing the block using different queues.

The slot recycle rates (206) may be a data structure that includesinformation regarding the rate at which slots of differing sizes are tobe recycled. The slot recycle rates (206) may be used by the cachemanager to determine when to perform recycling for each slot size. Theslot recycle rate for each slot size may be determined based on cacheuse data. The slot recycle rates (206) may be dynamically adjusted,using the cache use data, to reflect the storage workloads the dataprocessing device is encountering.

As discussed above, the slots (202) may be grouped. FIG. 220 shows adiagram of example slots (220) in accordance with one or moreembodiments of the invention. As discussed above, there may be anynumber of slots (e.g., 222.2, 222.4). The example slots (220) may belogically grouped into different slot groups (e.g., 222, 224). Each ofthe slot groups (e.g., 222, 224) may include any number of slots. As thenumber of slots of each size is dynamically adjusted by the cachemanager, the resulting number of slots in each of the slot groups (e.g.,222, 224) may change.

To further clarify aspects of embodiments of the invention, diagrams ofmethods that may be performed by components of the data processingdevice of FIG. 1 are shown in FIGS. 3.1-3.4.

FIG. 3.1 shows a flowchart of a method in accordance with one or moreembodiments of the invention. The method depicted in FIG. 3.1 be used tostore data in a cache in accordance with one or more embodiments of theinvention. The method shown in FIG. 3.1 may be performed by, forexample, input output managers (e.g., 104, FIG. 1). Other components ofthe system illustrated in FIG. 1 may perform all, or a portion, of themethod of FIG. 3.1 without departing from the invention.

While FIG. 3.1 is illustrated as a series of steps, any of the steps maybe omitted, performed in a different order, additional steps may beincluded, and/or any or all of the steps may be performed in a paralleland/or partially overlapping manner without departing from theinvention.

In step 300, the data storage request for data is obtained.

In one or more embodiments of the invention, the data storage request isobtained from an application. The data storage request may be obtainedfrom other entities without departing from the invention.

In one or more embodiments of the invention, the data is in a streamformat. The stream format may divide the data into any number of blocks.Each of the blocks may have a fixed size. For example, the fixed sizemay be 8 kilobytes, 16 kilobytes, 32 kilobytes, etc.

In step 302, an input output size for the data storage request isidentified.

In one or more embodiments of the invention, the input output size forthe data storage request is the size of the block. In other words, theinput output size may be the size of portions of the data as they willbe streamed for storage.

In step 304, the slot is selected based on the input output size.

In one or more embodiments of the invention, the slot is selected bymatching the input output size to the size of the slot. Once matched tothe size of the slot, a queue for that slot size may be used to identifythe slot. For example, the queue for the matched size of the slot mayspecify the next slot of the size of the slot in which to store data.The slot specified by the queue may be used as the selected slot.

In step 306, a portion of the data is stored in the selected slot.

In one or more embodiments of the invention, the portion of the data isa block of the data that is the size of the slot. Steps 304 and 306 maybe repeated for storing any number of portions of the data. By doing so,all of the portions of the data may be stored in slots having the samesize as the portions of the data.

The method may end following step 306.

FIG. 3.2 shows a flowchart of a method in accordance with one or moreembodiments of the invention. The method depicted in FIG. 3.2 be used togenerate cache use data and/or update slot cycle rates using the cacheuse data in accordance with one or more embodiments of the invention.The method shown in FIG. 3.2 may be performed by, for example, a cachemanager (e.g., 106, FIG. 1). Other components of the system illustratedin FIG. 1 may perform all, or a portion, of the method of FIG. 3.2without departing from the invention.

While FIG. 3.2 is illustrated as a series of steps, any of the steps maybe omitted, performed in a different order, additional steps may beincluded, and/or any or all of the steps may be performed in a paralleland/or partially overlapping manner without departing from theinvention.

In step 310, a cache slot allocation rate is identified.

In one or more embodiments of the invention, the cache slot allocationrate is identified by monitoring use of the cache. In one or moreembodiments of the invention, the cache slot allocation rate for eachslot size is monitored. The cache slot allocation rate may be monitoredbased on the rate at which slots are allocated by a queue associatedwith each slot size.

In step 312, a number of cached writes to persistent storage areidentified. The number of cached writes to persistent storage may beidentified by monitoring use of the cache. In one or more embodiments ofthe invention, the number of cached writes to persistent storage areidentified for each slot size.

The number of cached writes may be identified by determining each slotof a particular size storing a portion of data. When a cached write iswritten to persistent storage, the slot may be released. Thus, onlythose slots of the particular size storing data that have not beenreleased may counted to identify the number of cached writes for theparticular slot size.

In step 314, a depth of a slot queue is identified. In one or moreembodiments of the invention, the depth of the slot queue for each slotsize is identified. The slot queue size for each slot size may beidentified by determining the number of slots in the slot queue of eachrespective slot size.

In step 316, a fall through time of the cache is identified. The fallthrough time may be the average fall through time for slots of aparticular size. The fall through time for each slot size may beidentified. The fall through time for each slot size may be identifiedby determining the average time between when each slot of the slot sizeis used (i.e., used to store data) and when the respective slot is madeavailable for reuse (available to store second data).

In Step 318, cache use data is generated using the cache slot allocationrate, the number of cached writes, the depth of the slot queue, and thefall through time.

In one or more embodiments of the invention, the cache use data isgenerated by adding the aforementioned information obtained in steps310-316 to existing cache use data. In one or more embodiments of theinvention, the cache use data is generated by instantiating a datastructure to store the aforementioned information obtained in steps310-316.

In step 320, the slot recycle rates are updated using the cache usedata.

In one or more embodiments of the invention, the slot recycle rates areupdated by estimating the rate at which slots of each slot size need tobe made available to ensure that slots of each slot size are availablefor storing blocks of data of each slot size. The determined rates maybe used to determine the slot recycle rates by setting the slot recyclerate to a predetermined amount larger than the rate at which slots ofeach slot size need to be made available to ensure that slots of eachslot size are available for storing blocks of data of each slot size.The predetermined amount may be, for example 10%. Other predeterminedamounts may be used without departing from the invention.

The method may end following step 320.

FIG. 3.3 shows a flowchart of a method in accordance with one or moreembodiments of the invention. The method depicted in FIG. 3.3 be used torecycle slots in accordance with one or more embodiments of theinvention. The method shown in FIG. 3.3 may be performed by, forexample, a cache manager (e.g., 106, FIG. 1). Other components of thesystem illustrated in FIG. 1 may perform all, or a portion, of themethod of FIG. 3.3 without departing from the invention.

While FIG. 3.3 is illustrated as a series of steps, any of the steps maybe omitted, performed in a different order, additional steps may beincluded, and/or any or all of the steps may be performed in a paralleland/or partially overlapping manner without departing from theinvention.

In step 330, a cache recycle event is identified.

In one or more embodiments of the invention, the cache recycle event isa point in time determined by a cache recycle rate associated with aslot size. For example, the cache recycle rate may specify a certainnumber of slots of the slot size that are to be recycled every 100milliseconds. Thus, every 100 milliseconds a cache recycle event mayoccur. The cache recycle event may be identified by a schedule of whenrecycling of slots of the slot size associated with the cache recyclerate is to be performed.

The cache recycle event may be identified via other methods withoutdeparting from the invention. For example, the cache recycle event maybe the depth of a slot queue reaching a predetermined value size.

In step 332, a slot for recycling is identified.

In one or more embodiments of the invention, the slot for recycling isidentified by finding a slot that is not locked and that has a slot sizethe same as that associated with the cache recycle event. For example,when a slot is used for storing a block of data, the slot may be lockeduntil its contents are stored in persistent storage. Once its contentsare stored in persistent storage, the slot may be unlocked to indicatethat it is available.

In step 334, the slot is locked.

In one or more embodiments of the invention, locking the slot preventsdata blocks from being stored in the slot and/or being otherwise used.

In step 336, the locked slot is allocated to a slot queue. Allocatingthe locked slot to the slot queue may queue the locked slot for futurestorage of data. The slot queue may be associated with the size of thelocked slot. For example, the slot queue may only be for slots of thesize of the locked slot.

The method may end following step 336.

FIG. 3.4 shows a flowchart of a method in accordance with one or moreembodiments of the invention. The method depicted in FIG. 3.4 be used toreformat a cache in accordance with one or more embodiments of theinvention. The method shown in FIG. 3.4 may be performed by, forexample, a cache manager (e.g., 106, FIG. 1). Other components of thesystem illustrated in FIG. 1 may perform all, or a portion, of themethod of FIG. 3.4 without departing from the invention.

While FIG. 3.4 is illustrated as a series of steps, any of the steps maybe omitted, performed in a different order, additional steps may beincluded, and/or any or all of the steps may be performed in a paralleland/or partially overlapping manner without departing from theinvention.

In step 340, a cache update event is identified.

In one or more embodiments of the invention, the cache update event isidentified using cache use data. For example, the cache update event maybe identified by determining that the number of slots of the cachehaving a slot size is too small. The determination may be made usingcache use data by estimating whether it is likely that the number ofslots having the slot size will be unable to handle a storage workloadassociated with the slot size. In other words, whether it is likely thatthe storage workload will result in data blocks being stored in slotsthat are of a different size then the data blocks.

In step 342, a slot allocation of cache is identified.

In one or more embodiments of the invention, the slot allocation of thecache is relative number of slots of each slot size of the cache.

In step 344, the new slot allocation is determined based on the cacheuse data.

In one or more embodiments of the invention, the new slot allocationspecifies that the number of slots of a slot size is to be increased ordecreased when compared to the slot allocation.

In step 346, the cache is reformatted based on the new slot allocation.

In one or more embodiments of the invention, reformatting the cachebased on the new slot allocation changes the number of slots of eachsize of the cache to match that specified by the new slot allocation. Inother words, one or more slots of one slot size are modified to have asecond slot size. By doing so, the number of slots of each slot size maybe dynamically adjusted.

The method may end following Step 346.

To further clarify embodiments of the invention, a non-limiting exampleis provided in FIGS. 4.1-4.5. Each of these figures may illustrate asystem and/or data of the system similar to that illustrated in FIG. 1at different points in times. For the sake of brevity, only a limitednumber of components of the system of FIG. 1 are illustrated in each ofFIGS. 4.1-4.5.

Example

Consider a scenario as illustrated in FIG. 4.1 in which the dataprocessing device (400) is hosting the database application (402) and anemail application (404). To provide data storage services to thedatabase application (402) and the email application (404). The dataprocessing device (400) includes a cache (410).

Between the database application (402) and the email application (404),the database application (402) places a much larger storage workload onthe data processing device (400). For example, the database application(402) may be constantly updating the database as new data is added tothe database.

When the database application (402) stores data, it uses a block size of32 kilobytes (kB). In contrast, the email application (404) uses a blocksize of 8 kB. Consequently, when the data processing device (400)structured its cache (410), the cache included a small number of 8 kBslots (412), no 16 kB slots (414), and a large number of 32 kB slots(416). For example, the cache (410) includes 10 slots that are 8 kB wideand 20 slots that are 32 kB wide. Thus, the slots of the cache (410)have been tailored to match the relative stored workloads imposed uponthe data processing device (400).

Over time, the workload on the database application (402) increased. Toaddress the increased workload of the database application (402),administrator of the data processing device (400) move the emailapplication (404) to another device as illustrated in FIG. 4.2. Once theemail application (404) was removed, the 8 kB slots (412) of the cache(410) are no longer used because the database application (402) storesblocks of 32 kilobytes in size.

While the data processing device (400) was operating in the state shownin FIG. 4.2, cache use data was collected which reflects that now unused8 kB slots (412). To more efficiently use the cache (410), the dataprocessing device (400) reformatted the cache (410) based on thecollected cache use data as shown in FIG. 4.3. As seen from FIG. 4.3,reformatting the cache (410) resulted in the number of 8 kB slots (412)being decreased to two slots and the 32 kB slots (416) being increasedto 22 slots. Thus, by reformatting the cache (410), the number of slotshaving a slot size that corresponds to the block size being stored inthe cache (410) better matching.

After reformatting the cache (410), the administrator of the dataprocessing device (400) loaded a webpage server application (406) findto the data processing device (400) as illustrated in FIG. 4.4. Thewebpage server application (406) has a storage workload similar to thatof the database application (402) but stores blocks of 16 kilobytes andwith rather than the 32 kB with of the blocks stored by the databaseapplication (402).

After loading the webpage server application (406), the data processingdevice (400) updates the cache use data based on the new data blocksbeing stored in the cache (410). Because the cache (410) does notinclude any 16 kB slots (414), the cache use data indicates that 32 kBslots are being used to store the blocks from the webpage serverapplication (406).

To more efficiently use the cache (410), the data processing device(400) reformats the cache (410) as illustrated in FIG. 4.5. Afterreformatting, the cache (410) includes 16 slots that are 16 kB slots(414) and 14 slots that are 32 kB slots (416). Thus, the reformattedcache (410) now includes slots that are of the same size as thoseprovided for storage by the database application (402) and the webpageserver application (406). Consequently, the efficiency of using thecache (410) is improved because the 16 kB blocks generated by thewebpage server application (406) are no longer being stored in the 32 kBslots (416), which was resulting in half of each of the used 32 kB slots(416) being empty.

End of Example

As discussed above, embodiments of the invention may be implementedusing computing devices. FIG. 5 shows a diagram of a computing device inaccordance with one or more embodiments of the invention. The computingdevice (500) may include one or more computer processors (502),non-persistent storage (504) (e.g., volatile memory, such as randomaccess memory (RAM), cache memory), persistent storage (506) (e.g., ahard disk, an optical drive such as a compact disk (CD) drive or digitalversatile disk (DVD) drive, a flash memory, etc.), a communicationinterface (512) (e.g., Bluetooth interface, infrared interface, networkinterface, optical interface, etc.), input devices (510), output devices(508), and numerous other elements (not shown) and functionalities. Eachof these components is described below.

In one embodiment of the invention, the computer processor(s) (502) maybe an integrated circuit for processing instructions. For example, thecomputer processor(s) may be one or more cores or micro-cores of aprocessor. The computing device (500) may also include one or more inputdevices (510), such as a touchscreen, keyboard, mouse, microphone,touchpad, electronic pen, or any other type of input device. Further,the communication interface (512) may include an integrated circuit forconnecting the computing device (500) to a network (not shown) (e.g., alocal area network (LAN), a wide area network (WAN) such as theInternet, mobile network, or any other type of network) and/or toanother device, such as another computing device.

In one embodiment of the invention, the computing device (500) mayinclude one or more output devices (508), such as a screen (e.g., aliquid crystal display (LCD), a plasma display, touchscreen, cathode raytube (CRT) monitor, projector, or other display device), a printer,external storage, or any other output device. One or more of the outputdevices may be the same or different from the input device(s). The inputand output device(s) may be locally or remotely connected to thecomputer processor(s) (502), non-persistent storage (504), andpersistent storage (506). Many different types of computing devicesexist, and the aforementioned input and output device(s) may take otherforms.

Embodiments of the invention may provide a cache that dynamicallyupdates the number of slots of different slot sizes for caching data forstorage in the persistent storage. By doing so, data may be cached in amore efficient manner when compared to contemporary methods. Forexample, by dynamically allocating the number of slots of each slotsize, the size of the slots used to store data blocks may be matched tothe size of the data blocks. Doing so may reduce the effective storagefootprint by ensuring that each slot is fully used for storing dataand/or the number of slots allocated to store each block is a singleallocation.

Thus, embodiments of the invention may address the problem of mismatchesbetween block sizes to be stored in a cache and the size of the slots ofthe cache. The aforementioned problem arises due to the technologicalenvironment in which caching of data is used due to limitations in theaddressability of storage resources of computing devices.

The problems discussed above should be understood as being examples ofproblems solved by embodiments of the invention disclosed herein and theinvention should not be limited to solving the same/similar problems.The disclosed invention is broadly applicable to address a range ofproblems beyond those discussed herein.

One or more embodiments of the invention may be implemented usinginstructions executed by one or more processors of the data managementdevice. Further, such instructions may correspond to computer readableinstructions that are stored on one or more non-transitory computerreadable mediums.

While the invention has been described above with respect to a limitednumber of embodiments, those skilled in the art, having the benefit ofthis disclosure, will appreciate that other embodiments can be devisedwhich do not depart from the scope of the invention as disclosed herein.Accordingly, the scope of the invention should be limited only by theattached claims.

What is claimed is:
 1. A data processing device, comprising: cache forstoring data, wherein the cache is divided into a plurality of slotgroups each associated with a different slot size, and wherein thedifferent slot size associated with each of the slot groups of theplurality of slot groups is a size of each slot of the respective slotgroup of the plurality of slot groups; and a cache manager programmedto: monitor use of the cache to obtain cache use data; identify a slotallocation of a number of slots in each of the plurality of slot groups;generate a new slot allocation for the number of slots in each of theplurality of slot groups based on the cache use data, the size of eachslot of the respective slot group of the plurality of slot groups, andthe slot allocation; and reformat the cache based on the new slotallocation to obtain an updated cache.
 2. The data processing device ofclaim 1, wherein a slot size associated with a first slot group of theplurality of slot groups is different from a second slot size associatedwith a second slot group of the plurality of slot groups.
 3. The dataprocessing device of claim 1, wherein the cache use data comprises: acache slot allocation rate of the cache; a number of cached writing ofthe cache to persistent storage, wherein the persistent storage isoperatively connected to the cache; a depth of a slot queue associatedwith a slot from among the plurality of slot groups of the cache; and afall through time of the cache.
 4. The data processing device of claim1, wherein the cache manager is further programmed to: obtain a datastorage request for data; identify an input output size for the datastore request; select a slot of the cache based on the input outputsize; and store a portion of the slot.
 5. The data processing device ofclaim 1, wherein the cache manager is further programmed to: identify acache recycle event; in response to identifying the cache recycle event:identify a slot for recycling; lock the slot; and allocate the lockedslot to a slot queue.
 6. The data processing device of claim 5, whereinthe cache manager is further programmed to: update slot recycle ratesusing the cache use data, wherein the cache recycle event is specifiedby the slot recycle rates.
 7. The data processing device of claim 1,further comprising: an input output manager that stores data in thecache in a slot selected based on a block size of the data and a size ofthe slot.
 8. The data processing device of claim 7, wherein the inputoutput manager operates independently from the cache manager.
 9. Amethod for managing a cache, the method comprising: monitoring use ofthe cache to obtain cache use data, wherein the cache is divided into aplurality of slot groups each associated with a different slot size, andwherein the different slot size associated with each of the slot groupsof the plurality of slot groups is a size of each slot of the respectiveslot group of the plurality of slot groups; identifying a slotallocation of a number of slots in each of the plurality of slot groups;generating a new slot allocation for the number of slots in each of theplurality of slot groups based on the cache use data, the size of eachslot of the respective slot group of the plurality of slot groups, andthe slot allocation; and reformatting the cache based on the new slotallocation to obtain an updated cache.
 10. The method of claim 9,wherein a slot size associated with a first slot group of the pluralityof slot groups is different from a second slot size associated with asecond slot group of the plurality of slot groups.
 11. The method ofclaim 9, wherein the cache use data comprises: a cache slot allocationrate of the cache; a number of cached writing of the cache to persistentstorage, wherein the data processing device comprises the persistentstorage; a depth of a slot queue associated with a slot from among theplurality of slot groups of the cache; and a fall through time of thecache.
 12. A non-transitory computer readable medium comprising computerreadable program code, which when executed by a computer processorenables the computer processor to perform a method for managing a cache,the method comprising: monitoring use of the cache to obtain cache usedata, wherein the cache is divided into a plurality of slot groups eachassociated with a different slot size, and wherein the different slotsize associated with each of the slot groups of the plurality of slotgroups is a size of each slot of the respective slot group of theplurality of slot groups; identifying a slot allocation of a number ofslots in each of the plurality of slot groups; generating a new slotallocation for the number of slots in each of the plurality of slotgroups based on the cache use data, the size of each slot of therespective slot group of the plurality of slot groups, and the slotallocation; and reformatting the cache based on the new slot allocationto obtain an updated cache.
 13. The non-transitory computer readablemedium of claim 12, wherein a slot size associated with a first slotgroup of the plurality of slot groups is different from a second slotsize associated with a second slot group of the plurality of slotgroups.
 14. The non-transitory computer readable medium of claim 12,wherein the cache use data comprises: a cache slot allocation rate ofthe cache; a number of cached writing of the cache to persistentstorage, wherein the data processing device comprises the persistentstorage; a depth of a slot queue associated with a slot from among theplurality of slot groups of the cache; and a fall through time of thecache.